﻿using StackExchange.Redis;

namespace Kevin.Dapr.Actors
{
    public class RedisHelper
    {
        /// <summary>
        /// Redis操作对象
        /// </summary>
        protected readonly IDatabase redis;
        /// <summary>
        /// 初始化Redis操作方法基础类
        /// </summary>
        /// <param name="dbNum"></param>
        public RedisHelper(string connstr = "192.168.0.10:6379,password=Jykj000000", int dbNum = 0)
        {
            redis = ConnectionMultiplexer.Connect(connstr).GetDatabase(dbNum);
        }
        public IDatabase GetDatabase()
        {
            return redis;
        }

    }
}
